<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">


<link rel="stylesheet" href="../../css/iconfont/iconfont.css">
<link rel="stylesheet" href="../../css/easyui/easyui.css">
<link rel="stylesheet" href="../../css/easyui/icon.css">
<link rel="stylesheet" href="../../css/css.css">
<link rel="stylesheet" href="../../css/site.css">
<link rel="stylesheet" href="../../css/view/equBasic/EquBasic.css">

<script src="../../js/common/jQuery.js"></script>
<script src="../../js/common/jquery.easyui.min.js"></script>
<script src="../../js/common/app.js"></script>
<script src="../../js/common/common.js"></script>
<script src="../../js/common/slidebar.js"></script>
<script src="../../js/common/easyui-lang-zh_CN.js"></script>
    <style type="text/css">
        .addtextbox{width: 80%;height: auto;overflow: hidden;margin: 10px auto;}
        .addtextbox h4{font-size: 16px;}
        #addtextbox1,#addtextbox2,#addtextbox3,.addtextbox4{width: 30%;height: auto;overflow: hidden;float: left;margin-right: 3%;}
        .addtextbox p{width: 100%;height: auto;overflow: hidden;}
        .addtextbox p span{width: 100px;display: block;float: left;text-align:center;}
        .add_btn,.del_btn{width:20px;height:20px;float: left;display:block;border-radius:50%;background:#0388d6;color: #fff;text-align: center;line-height:20px;font-weight: bolder;cursor: pointer;}
        .del_btn{background:#ccc;margin: 3px 5px;}
        .spot{width: 100%;height:auto;overflow: hidden; margin-bottom: 15px;}
        .spot input{width: 160px;height:26px;float:left;border:1px solid #ccc;text-indent: 5px;}
    </style>
    <script type="text/javascript">
        function show(obj,id,inputname){
            $('#'+ id).append(
                '<div class="spot">' + '<input type="text" name='+inputname+'> ' + '<a class="del_btn remove"">-</a></div>'
            ).find('a.remove').click(function(){
                $(this).parent().remove();
                $('input#add').show();
            });
        }
    </script>

<body>
<form id="settingForm" onsubmit="return false" action="##" method="post" >
    <div class="addtextbox">
        <h4>资产基本信息下拉框设置</h4>

            <div id="addtextbox1">
                <p><span><input type="text" value="类别" name="equtype" readonly="readonly" style="width: 100px"></span> <a class="add_btn" onClick="show(this,'addtextbox1','EquType')" vule='添加'>+</a></p>
            </div>
    </div>
    <input type="submit" onclick="submitSetting()" value="保存" />
</form>
<script>
    var submitSetting = function () {
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "../../goLogis/saveSettings" ,//url
            data: $('#settingForm').serialize(),
            success: function (result) {
                console.log(result);//打印服务端返回的数据(调试用)
                if (result.status == "1") {
                    // window.location.reload();
                    $.messager.alert("提示","保存成功");
                }else {
                    window.location.reload();
                    $.messager.alert("提示","保存失败");
                };
            },
            error : function() {
                alert("异常！");
            }
        });
    }

</script>
</body>